package com.zhangyutong.controller;

import com.zhangyutong.bean.Admin;
import com.zhangyutong.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/admin")
//允许跨域
@CrossOrigin
public class AdminController {
    //依赖注入
    @Autowired
    AdminService adminService;
    @RequestMapping("/list")
    public List<Admin> getlist(){
        List<Admin> list = adminService.list();
        return  list;
    }
}